package com.qianfeng.controller;

import com.qianfeng.dto.Result;
import com.qianfeng.entity.Subject;
import com.qianfeng.entity.SubjectType;
import com.qianfeng.service.SubjectTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@ResponseBody
@CrossOrigin
@RequestMapping(value = "/subjectType")
@Controller
public class SubjectTypeController {

    @Autowired
    private SubjectTypeService subjectTypeService;

    @RequestMapping(value = "/getSubjectTypeList")
    public Result getSubjectTypeList(){
        List<SubjectType> subjectTypeList = subjectTypeService.getSubjectTypeList();
        Result result = new Result();
        result.setData(subjectTypeList);
        return result;
    }

}
